package com.test.sdk.sender.service;

import com.test.sdk.sender.dao.SenderDAO;
import com.test.sdk.sender.pojo.SenderQueue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Service;

@Service
public class SenderService {
    @Autowired
    private SenderDAO senderDAO;

    @JmsListener(destination = "sdk-sender")
    public void readMsg(String text) {
        //155366751313202
        System.out.println("接收到消息：" + text);
        //根据接收到的orderId 查询出userid和amount  extInfo中的serverId和roleId
        //根绝serverId查询gameServer表 查询出noticeUrl 此处省略，写个常量代替
        String noticeUrl="http://android.xtzj.wangamedia.com/notification/WHWJ";
        SenderQueue queue=new SenderQueue();
        queue.setNoticeUrl(noticeUrl);
        queue.setParam("extInfo");//应该是数据库订单中的extInfo 略
        senderDAO.addSenderQueue(queue);
        //通知游戏服务器
        //查询服务器的notice_url  发http请求通知发币

    }
}
